package Engine;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.MediaTracker;
import java.awt.TexturePaint;
import java.awt.Toolkit;
import java.awt.image.*;
import java.io.File;
import java.io.IOException;
import java.io.ObjectInputStream.GetField;
import java.net.URL;

import javax.imageio.ImageIO;

import org.lwjgl.Sys;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.opengl.TextureImpl;
import org.newdawn.slick.opengl.TextureLoader;
import org.newdawn.slick.util.ResourceLoader;
import static org.lwjgl.opengl.GL11.*;
public class Funktions
{
     public static Texture loadTexture(String file, int Filter) {
        
    	 try {
 			return TextureLoader.getTexture("PNG", ResourceLoader.getResourceAsStream(file), Filter);
 			
 		} catch (IOException e) {
 			// TODO Auto-generated catch block
 			e.printStackTrace();
 		}
    	 return null;
    }  
     public static BufferedImage loadImage(String file, Class _class) {
         
 
         BufferedImage img = null;
         try {
        	
             //img =  ImageIO.read(ResourceLoader.getResourceAsStream(file));
        	
        	 URL url = _class.getClassLoader().getResource(file);
        	 img = ImageIO.read(url);
         } catch (Exception e) {
        	 e.printStackTrace();
        	 Sys.alert("Error", e.getMessage()+"\nPfad: "+file);
         }
         return img;
     }
 
}
